package com.zwy.com.zwy.activti;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * @author 天火
 * @className ActivitiDeployment
 */
public class ActivitiDeployment {

    //流程定义部署
    public static void main(String[] args){
        //创建processEngine对象
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        //得到RepositoryService对象
        RepositoryService repositoryService = processEngine.getRepositoryService();

        //进行部署
        Deployment deployment = repositoryService.createDeployment()
                                .addClasspathResource("diagrams/holiday.bpmn")
                                .addClasspathResource("diagrams/holiday.png")
                                .name("请假流程")
                                .deploy();
        //输出部署
        System.out.println("流程部署Id：" + deployment.getId());
        System.out.println("流程部署名称：" + deployment.getName());
    }


}
